package com.gxl.butt.DAO.impl;
import com.gxl.butt.DAO.ISumMessageDAO;
import com.gxl.butt.domain.SumOfMessage;
import org.apache.kafka.common.metrics.stats.Sum;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
/**
 * Created by GUOXIAOLIN on 2018/11/14.
 */
@Repository
public class SumMesageDAOImpl extends HibernateBaseDao<SumOfMessage> implements ISumMessageDAO {
    @Override
    public Long saveDO(SumOfMessage sumOfMessage) {
        Long id = (Long) this.save(sumOfMessage);
        return id;
    }
    @Override
    public void updateDO(SumOfMessage sumOfMessage) {
        this.update(sumOfMessage);
    }
    @Override
    public List<SumOfMessage> getDO() {
        List<SumOfMessage> sumOfMessageList = this.getAll();
        if (sumOfMessageList != null && sumOfMessageList.size() != 0){
            return this.getAll();
        }
        return null;
    }
}
